package com.hz.friends.activity;

import java.util.Random;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class AttentionActivity extends BaseActivity {
	private ListView mlistview;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_attenttion);
		initViews();
	}

	@Override
	protected void init() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void initViews() {

		ImageButton imbtn_bar_left = (ImageButton) findViewById(R.id.imbtn_bar_left);
		ImageButton imbtn_bar_right = (ImageButton) findViewById(R.id.imbtn_bar_right);
		TextView imbtn_bar_title = (TextView) findViewById(R.id.imbtn_bar_title);
		imbtn_bar_right.setVisibility(View.INVISIBLE);
		imbtn_bar_left.setImageResource(R.drawable.ic_leftback_arrow);
		imbtn_bar_title.setText("Pay attentoin to");
		imbtn_bar_left.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
               finish();				
			}
		});
		 mlistview = (ListView) findViewById(R.id.mlistview);
		 
		 MyAdpter adpter = new MyAdpter();
		 mlistview.setAdapter( adpter);
	}

	@Override
	protected void setViews() {
 
	}

	@Override
	protected void initEvents() {
		// TODO Auto-generated method stub

	}
  
	class MyAdpter extends BaseAdapter{

		@Override
		public int getCount() {
			return 15;
		}

		@Override
		public Object getItem(int position) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public long getItemId(int position) {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			View view = LayoutInflater.from(AttentionActivity.this).inflate(R.layout.adpter_attent, null);
			ImageView imv_heard = (ImageView)view.findViewById(R.id.imv_heard);
			TextView txv_name = (TextView)view.findViewById(R.id.txv_name);
			LinearLayout layout_sex = (LinearLayout)view.findViewById(R.id.layout_sex);
			ImageView imv_sex = (ImageView)view.findViewById(R.id.imv_sex);
			TextView txv_age = (TextView)view.findViewById(R.id.txv_age);
			TextView txv_clock = (TextView)view.findViewById(R.id.txv_clock);
			TextView txv_content = (TextView)view.findViewById(R.id.txv_content);
			int[] ress = {R.drawable.test_heard_1,R.drawable.test_heard_2,R.drawable.test_heard_3,R.drawable.test_heard_4,R.drawable.test_heard_5,R.drawable.test_heard_6};
			String[] names = {"cindy","achel","sunny","vicky","vincent","caroline"};
			int[] ages = {18,19,20,21,22,23,24,25,16,15};
//			String[] clocks = {"08-21 10:08","08-21 16:11","08-23 16:11","08-25 1:00","08-28 16:23","08-19 08:00"};
			Random random = new Random();
//		    Bitmap heardbitm = BitmapUtils.getCircleStrokbitmap(InvitationActivity.this, BitmapFactory.decodeResource(getResources(), ress[random.nextInt(ress.length)]), width, strok, strokcolor)
			
 			return view;
		}
		
	}
}
